﻿/*
 * XCoder v3.2.2010.1014
 * 作者：SUN/SUN-PC
 * 时间：2010-12-22 19:58:37
 * 版权：版权所有 (C) 新生命开发团队 2010
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;

namespace NewLife.YWS.Entities
{
    /// <summary>
    /// 客户
    /// </summary>
    [Serializable]
    [DataObject]
    [Description("客户")]
    [BindTable("Customer", Description = "客户", ConnName = "YWS")]
    public partial class Customer : YWSEntityBase<Customer>
    {
        #region 属性
        private Int32 _ID;
        /// <summary>
        /// 编号
        /// </summary>
        [Description("编号")]
        [DataObjectField(true, true, false, 10)]
        [BindColumn("ID", Description = "编号", DefaultValue = "", Order = 1)]
        public Int32 ID
        {
            get { return _ID; }
            set { if (OnPropertyChange("ID", value)) _ID = value; }
        }

        private String _No;
        /// <summary>
        /// 客户编号
        /// </summary>
        [Description("客户编号")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("No", Description = "客户编号", DefaultValue = "", Order = 2)]
        public String No
        {
            get { return _No; }
            set { if (OnPropertyChange("No", value)) _No = value; }
        }

        private String _Name;
        /// <summary>
        /// 名称
        /// </summary>
        [Description("名称")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Name", Description = "名称", DefaultValue = "", Order = 3)]
        public String Name
        {
            get { return _Name; }
            set { if (OnPropertyChange("Name", value)) _Name = value; }
        }

        private String _Linkman;
        /// <summary>
        /// 联系人
        /// </summary>
        [Description("联系人")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Linkman", Description = "联系人", DefaultValue = "", Order = 4)]
        public String Linkman
        {
            get { return _Linkman; }
            set { if (OnPropertyChange("Linkman", value)) _Linkman = value; }
        }

        private String _Department;
        /// <summary>
        /// 部门
        /// </summary>
        [Description("部门")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Department", Description = "部门", DefaultValue = "", Order = 5)]
        public String Department
        {
            get { return _Department; }
            set { if (OnPropertyChange("Department", value)) _Department = value; }
        }

        private String _Tel;
        /// <summary>
        /// 电话
        /// </summary>
        [Description("电话")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Tel", Description = "电话", DefaultValue = "", Order = 6)]
        public String Tel
        {
            get { return _Tel; }
            set { if (OnPropertyChange("Tel", value)) _Tel = value; }
        }

        private String _Fax;
        /// <summary>
        /// 传真
        /// </summary>
        [Description("传真")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Fax", Description = "传真", DefaultValue = "", Order = 7)]
        public String Fax
        {
            get { return _Fax; }
            set { if (OnPropertyChange("Fax", value)) _Fax = value; }
        }

        private String _Email;
        /// <summary>
        /// 邮箱
        /// </summary>
        [Description("邮箱")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Email", Description = "邮箱", DefaultValue = "", Order = 8)]
        public String Email
        {
            get { return _Email; }
            set { if (OnPropertyChange("Email", value)) _Email = value; }
        }

        private String _QQ;
        /// <summary>
        /// QQ
        /// </summary>
        [Description("QQ")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("QQ", Description = "QQ", DefaultValue = "", Order = 9)]
        public String QQ
        {
            get { return _QQ; }
            set { if (OnPropertyChange("QQ", value)) _QQ = value; }
        }

        private String _MSN;
        /// <summary>
        /// MSN
        /// </summary>
        [Description("MSN")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("MSN", Description = "MSN", DefaultValue = "", Order = 10)]
        public String MSN
        {
            get { return _MSN; }
            set { if (OnPropertyChange("MSN", value)) _MSN = value; }
        }

        private String _Address;
        /// <summary>
        /// 客户地址
        /// </summary>
        [Description("客户地址")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Address", Description = "客户地址", DefaultValue = "", Order = 11)]
        public String Address
        {
            get { return _Address; }
            set { if (OnPropertyChange("Address", value)) _Address = value; }
        }

        private DateTime _AddTime;
        /// <summary>
        /// 添加时间
        /// </summary>
        [Description("添加时间")]
        [DataObjectField(false, false, true, 23)]
        [BindColumn("AddTime", Description = "添加时间", DefaultValue = "", Order = 12)]
        public DateTime AddTime
        {
            get { return _AddTime; }
            set { if (OnPropertyChange("AddTime", value)) _AddTime = value; }
        }

        private String _Remark;
        /// <summary>
        /// 备注
        /// </summary>
        [Description("备注")]
        [DataObjectField(false, false, true, 100)]
        [BindColumn("Remark", Description = "备注", DefaultValue = "", Order = 13)]
        public String Remark
        {
            get { return _Remark; }
            set { if (OnPropertyChange("Remark", value)) _Remark = value; }
        }

        private Int32 _TypeID;
        /// <summary>
        /// 类别
        /// </summary>
        [Description("类别")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn("TypeID", Description = "类别", DefaultValue = "", Order = 14)]
        public Int32 TypeID
        {
            get { return _TypeID; }
            set { if (OnPropertyChange("TypeID", value)) _TypeID = value; }
        }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// 一个索引，基类使用反射实现。
        /// 派生实体类可重写该索引，以避免反射带来的性能损耗
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case "ID": return ID;
                    case "No": return No;
                    case "Name": return Name;
                    case "Linkman": return Linkman;
                    case "Department": return Department;
                    case "Tel": return Tel;
                    case "Fax": return Fax;
                    case "Email": return Email;
                    case "QQ": return QQ;
                    case "MSN": return MSN;
                    case "Address": return Address;
                    case "AddTime": return AddTime;
                    case "Remark": return Remark;
                    case "TypeID": return TypeID;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case "ID": _ID = Convert.ToInt32(value); break;
                    case "No": _No = Convert.ToString(value); break;
                    case "Name": _Name = Convert.ToString(value); break;
                    case "Linkman": _Linkman = Convert.ToString(value); break;
                    case "Department": _Department = Convert.ToString(value); break;
                    case "Tel": _Tel = Convert.ToString(value); break;
                    case "Fax": _Fax = Convert.ToString(value); break;
                    case "Email": _Email = Convert.ToString(value); break;
                    case "QQ": _QQ = Convert.ToString(value); break;
                    case "MSN": _MSN = Convert.ToString(value); break;
                    case "Address": _Address = Convert.ToString(value); break;
                    case "AddTime": _AddTime = Convert.ToDateTime(value); break;
                    case "Remark": _Remark = Convert.ToString(value); break;
                    case "TypeID": _TypeID = Convert.ToInt32(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>
        /// 取得客户字段名的快捷方式
        /// </summary>
        public class _
        {
            ///<summary>
            /// 编号
            ///</summary>
            public const String ID = "ID";

            ///<summary>
            /// 客户编号
            ///</summary>
            public const String No = "No";

            ///<summary>
            /// 名称
            ///</summary>
            public const String Name = "Name";

            ///<summary>
            /// 联系人
            ///</summary>
            public const String Linkman = "Linkman";

            ///<summary>
            /// 部门
            ///</summary>
            public const String Department = "Department";

            ///<summary>
            /// 电话
            ///</summary>
            public const String Tel = "Tel";

            ///<summary>
            /// 传真
            ///</summary>
            public const String Fax = "Fax";

            ///<summary>
            /// 邮箱
            ///</summary>
            public const String Email = "Email";

            ///<summary>
            /// QQ
            ///</summary>
            public const String QQ = "QQ";

            ///<summary>
            /// MSN
            ///</summary>
            public const String MSN = "MSN";

            ///<summary>
            /// 客户地址
            ///</summary>
            public const String Address = "Address";

            ///<summary>
            /// 添加时间
            ///</summary>
            public const String AddTime = "AddTime";

            ///<summary>
            /// 备注
            ///</summary>
            public const String Remark = "Remark";

            ///<summary>
            /// 类别
            ///</summary>
            public const String TypeID = "TypeID";
        }
        #endregion
    }
}